﻿using System;
using System.Collections.Generic;
using System.Text;

namespace BLL
{
   public static  class LotteryChipped_Zxgl
    {
        private static Data.LotteryChipped_Zxgl Data_Newscont = new Data.LotteryChipped_Zxgl();

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static long Add(Model.LotteryChipped_Zxgl model)
        {
            return Data_Newscont.Add(model);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static int Update(Model.LotteryChipped_Zxgl model)
        {
            return Data_Newscont.Update(model);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public static bool Delete(long Id)
        {
            return Data_Newscont.Delete(Id);
        }
        /// <summary>
        /// 单条
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public static Model.LotteryChipped_Zxgl GetModel(long Id)
        {
            return Data_Newscont.GetModel(Id);
        }
        /// <summary>
        /// 上一篇
        /// </summary>
        /// <param name="IndexID"></param>
        /// <param name="tName"></param>
        /// <param name="condition"></param>
        /// <returns></returns>
        public static Model.LotteryChipped_Zxgl Prv(long IndexID, string condition)
        {
            string sql = "";
            if (condition == "")
            {

                sql = "SELECT top 1  * FROM LotteryChipped WHERE Id <" + IndexID + " ORDER BY Id DESC";
            }
            else
            {
                sql = "select top 1 * from LotteryChipped where Id<" + IndexID + " and " + condition + " order by Id desc";
            }

            return Data_Newscont.GetModelBysql(sql);

        }
        public static Model.LotteryChipped_Zxgl NewsTopOne(string sql)
        {
            return Data_Newscont.GetModelBysql(sql);

        }
        /// <summary>
        /// 下一篇
        /// </summary>
        /// <param name="IndexID"></param>
        /// <param name="tName"></param>
        /// <param name="condition"></param>
        /// <returns></returns>
        public static Model.LotteryChipped_Zxgl Next(long IndexID, string condition)
        {
            string sql = "";
            if (condition == "")
            {
                sql = "SELECT top 1 * FROM LotteryChipped WHERE Id >" + IndexID + " ORDER BY Id asc";
            }
            else
            {
                sql = "select top 1 * from LotteryChipped where Id>" + IndexID + " and " + condition + " order by Id desc";
            }
            return Data_Newscont.GetModelBysql(sql);

        }
        /// <summary>
        /// 总数据数
        /// </summary>
        /// <returns></returns>
        public static int GetAll_Count()
        {
            return Data_Newscont.GetAll_Count();
        }
        /// <summary>
        /// 抽取分页数据
        /// </summary>
    }
}
